package com.star.security.authentication;

import com.star.security.exception.DisabledException;
import com.star.security.user.UserDetails;

/**
 * 帐户状态用户详细信息检查器
 *
 * @author yangzj
 */
public class UserDetailsCheckerImpl implements UserDetailsChecker {

    @Override
    public void check(UserDetails toCheck) {
        if (!toCheck.isEnabled()) {
            throw new DisabledException("用户已禁用");
        }
    }
}
